<template>
  <div>
    <template>
      <div class="search-input">
        <a-button type="primary" @click="searchSubmit">
          按钮
        </a-button>
      </div>
      <div class="search-input">
        <a-input  v-model="filterData.username" placeholder="用户名" />
      </div>
    </template>
  </div>
</template>

<script>
export default {
  name: "Search",
  data(){
    return {

    }
  },
  props: ['filterData'],     // 父组件中绑定的搜索表单数据
  methods:{
    // 点击搜索按钮，触发搜索事件
    searchSubmit(){
      this.$emit('filterMethod')    // 触发父组件中的filterUser方法进行过滤搜索功能
    }
  }

}
</script>

<style scoped>
.search-input {
  float: right;
  margin-right: 40px
}
</style>
